package com.winderinfo.yikaotianxia.ui.classification;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.winderinfo.yikaotianxia.core.utils.LogUtil;
import com.winderinfo.yikaotianxia.ui.home.ZhuanYeBean;

import java.util.List;

public class ListPagerAdapter extends FragmentPagerAdapter {

    private List<String> mTableList;
    //专业id
    private int id;

    public ListPagerAdapter(FragmentManager fm, List<String> mTableList, int id) {
        super(fm);
        this.mTableList = mTableList;
        this.id = id;
    }


    @Override
    public Fragment getItem(int i) {
        ListFragment listFragment = new ListFragment();
        Bundle bundle = new Bundle();
        bundle.putInt("position", i + 1);
        bundle.putInt("p_id", id);
        listFragment.setArguments(bundle);
        return listFragment;
    }

    @Override
    public int getCount() {
        return mTableList.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return mTableList.get(position);
    }
}
